import warnings

warnings.filterwarnings('ignore')
from ultralytics import YOLO

# weight = r"yolo-ladcs.pt"  # trained on coco ds
# weight = r"E:\pycharmProjs\yolo-ladcs\runs\train\exp12\weights\best.pt"  # trained on coco ds
weight = r"E:\experiments\YOLO-DDD\YOLOv8n-640input\exp11\weights\best.pt"
# weight = r"E:\experiments\YOLO-DDD\YOLOv8n-224input\exp12\weights\best.pt"

# img_vid_dir = r"E:\uav_datasets\Drone-vs-Bird Detection Challenge\train_videos\gopro_006.mp4"
# img_vid_dir = r"E:\dataset\Drone-detection-dataset\images\Bird\V_BIRD_020"
# img_path = r"E:\dataset\DDD_demo_videos2_frame\V_DRONE_009\frame_0292.jpg"
# img_path = r"E:\dataset\DDD_demo_videos2_frame\V_DRONE_027\frame_0006.jpg"
# img_path = r"E:\dataset\DVB_demo_videos_cp\00_02_45_to_00_03_10_cut.mp4"
img_path = r"E:\dataset\DVB_demo_videos_cp\2019_11_14_C0001_3922_matrice.mp4"

if __name__ == '__main__':
    model = YOLO(weight)  # select your model.pt path
    model.predict(source=img_path,
                  imgsz=640,
                  project='runs/detect',
                  name='exp',
                  save=True,
                  save_txt=True,
                  # conf=0.2,
                  # visualize=True # visualize model features maps
                  )
